/**
 * @param {string} s
 * @return {string[]}
 */
var ambiguousCoordinates = function (s) {
  let res = []
  let path = []
  function backtracking(string, k) {
    if (path.length == string.length) {
      res.push([...path])
      return
    }

    for (let i = k; i < string.length; i++) {
      path.push(string[i])
      backtracking(string, i + 1)
      path.pop()
    }
  }

  backtracking(s.slice(1,s.length-1), 0)
  console.log(res)
}

ambiguousCoordinates('(123)')
